<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>堆快照监控内存</title>
</head>
<body>
<button id="btn">Add</button>
<script>
	var tmpEle

	function fn() {
		var ul = document.createElement('ul')
		for (var i = 0; i < 10; i++) {
			var li = document.createElement('li')
			ul.appendChild(li)
		}
		tmpEle = ul // 分离DOM
		// ul = null // 清空节点 释放分离DOM
	}

	document.getElementById('btn').addEventListener('click', fn)
</script>
</body>
</html>
